from datetime import datetime

import tablib


def gen_filename(base):
    time = datetime.today().strftime('%Y-%m-%d-%H-%M-%S')
    return base + '-' + time + '.xlsx'


def get_file_date(items, header):
    data = tablib.Dataset(*items, headers=header)
    return data.xlsx


